<template>
	<view class="concatUs">
		<view class="concatBox">
			<view class="concatitem" v-for="(item,index) in pageData">
				<view class="leftitem">
					{{item.name}} ：{{item.tell}}
				</view>
				<view class="copy" @click="handleCopy(item.tell)">
					复制
				</view>
			</view>
		
		</view>

	</view>
</template>

<script>
	import {
		kefu
	} from "@/api/api.js"
	export default {
		data() {
			return {
				pageData: [],
			}
		},
		onLoad() {
			this.handlekefu()
		},
		methods: {
			async handlekefu() {
				let res = await kefu()
				this.pageData = res.data
			},
			//复制
			handleCopy(value) {
				uni.setClipboardData({
					data: value, //要被复制的内容
					success: () => {
						uni.showToast({
							title: '复制成功',
							icon: "none",
							duration: 1800
						});
					}
				});
			},
		}
	}
</script>

<style scoped lang="scss">
	.concatUs {
		width: 100%;
		min-height: 100%;
		background-color: #ffffff;

		.concatBox {
			width: 100%;
			display: flex;
			flex-direction: column;
			align-items: center;
			padding-top: 100rpx;
			box-sizing: border-box;

			.title {
				font-size: 32rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				color: #999999;
				line-height: 38rpx;
			}

			.concatitem {
				display: flex;
				align-items: center;
				margin-top: 20rpx;

				.leftitem {
					font-size: 36rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					color: #333333;
					line-height: 42rpx;
				}

				.copy {
					width: 64rpx;
					height: 34rpx;
					border: 1rpx solid #BBBBBB;
					border-radius: 8rpx;
					font-size: 24rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					color: #BBBBBB;
					line-height: 34rpx;
					text-align: center;
					margin-left: 20rpx;
				}
			}

		}
	}
</style>